package com.bwie;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CreateResult<T> {
    private int code;
    private String msg;
    private T data;

    public static <T> CreateResult<T> success(T data){
        return new CreateResult<>(200,"success",data);
    }

    public static <T> CreateResult<T> fail(int code,String msg){
        return new CreateResult<>(code,msg,null);
    }

}
